home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / a-swmwco.ads < prev    next >
Text File  |  1996-01-30  |  8KB  |  193 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. -- A D A . S T R I N G S . W I D E _ M A P S . W I D E _ C O N S T A N T S  --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.7 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25.  
  26. with Ada.Characters.Wide_Latin_1; use Ada.Characters.Wide_Latin_1;
  27.  
  28. package Ada.Strings.Wide_Maps.Wide_Constants is
  29.  
  30.    Control_Set           : constant Wide_Maps.Wide_Character_Set;
  31.    Graphic_Set           : constant Wide_Maps.Wide_Character_Set;
  32.    Letter_Set            : constant Wide_Maps.Wide_Character_Set;
  33.    Lower_Set             : constant Wide_Maps.Wide_Character_Set;
  34.    Upper_Set             : constant Wide_Maps.Wide_Character_Set;
  35.    Basic_Set             : constant Wide_Maps.Wide_Character_Set;
  36.    Decimal_Digit_Set     : constant Wide_Maps.Wide_Character_Set;
  37.    Hexadecimal_Digit_Set : constant Wide_Maps.Wide_Character_Set;
  38.    Alphanumeric_Set      : constant Wide_Maps.Wide_Character_Set;
  39.    Special_Graphic_Set   : constant Wide_Maps.Wide_Character_Set;
  40.    ISO_646_Set           : constant Wide_Maps.Wide_Character_Set;
  41.    Character_Set         : constant Wide_Maps.Wide_Character_Set;
  42.  
  43.    Lower_Case_Map        : constant Wide_Maps.Wide_Character_Mapping;
  44.    --  Maps to lower case for letters, else identity
  45.  
  46. private
  47.  
  48.    function To_Set_R
  49.      (Ranges : in Wide_Character_Ranges)
  50.       return   Wide_Character_Set
  51.    renames To_Set;
  52.  
  53.    function To_Set_S
  54.      (Span : in Wide_Character_Range)
  55.       return Wide_Character_Set
  56.    renames To_Set;
  57.  
  58.    subtype WC is Wide_Character;
  59.  
  60.    Control_Set           : constant Wide_Character_Set := To_Set_R (
  61.      ((NUL,                 US),
  62.       (DEL,                 APC)));
  63.  
  64.    Graphic_Set           : constant Wide_Character_Set := To_Set_R (
  65.      ((' ',                 Tilde),
  66.       (WC'Val (256),        WC'Last)));
  67.  
  68.    Letter_Set            : constant Wide_Character_Set := To_Set_R (
  69.      (('A',                 'Z'),
  70.       ('a',                 'z'),
  71.       (UC_A_Grave,          UC_O_Diaeresis),
  72.       (UC_O_Oblique_Stroke, LC_O_Diaeresis),
  73.       (LC_O_Oblique_Stroke, LC_Y_Diaeresis)));
  74.  
  75.    Lower_Set             : constant Wide_Character_Set := To_Set_R (
  76.      (('a',                 'z'),
  77.       (LC_German_Sharp_S,   LC_O_Diaeresis),
  78.       (LC_O_Oblique_Stroke, LC_Y_Diaeresis)));
  79.  
  80.    Upper_Set             : constant Wide_Character_Set := To_Set_R (
  81.      (('A',                 'Z'),
  82.       (UC_A_Grave,          UC_O_Diaeresis),
  83.       (UC_O_Oblique_Stroke, UC_Icelandic_Thorn)));
  84.  
  85.    Basic_Set             : constant Wide_Character_Set := To_Set_R (
  86.      (('A',                 'Z'),
  87.       ('a',                 'z'),
  88.       (UC_AE_Diphthong,     UC_AE_Diphthong),
  89.       (LC_AE_Diphthong,     LC_AE_Diphthong),
  90.       (LC_German_Sharp_S,   LC_German_Sharp_S),
  91.       (UC_Icelandic_Thorn,  UC_Icelandic_Thorn),
  92.       (LC_Icelandic_Thorn,  LC_Icelandic_Thorn),
  93.       (UC_Icelandic_Eth,    UC_Icelandic_Eth),
  94.       (LC_Icelandic_Eth,    LC_Icelandic_Eth)));
  95.  
  96.    Decimal_Digit_Set     : constant Wide_Character_Set := To_Set_S
  97.      (('0',                 '9'));
  98.  
  99.    Hexadecimal_Digit_Set : constant Wide_Character_Set := To_Set_R (
  100.      (('0',                 '9'),
  101.       ('A',                 'F'),
  102.       ('a',                 'f')));
  103.  
  104.    Alphanumeric_Set      : constant Wide_Character_Set := To_Set_R (
  105.      (('0',                 '9'),
  106.       ('A',                 'Z'),
  107.       ('a',                 'z'),
  108.       (UC_A_Grave,          UC_O_Diaeresis),
  109.       (UC_O_Oblique_Stroke, LC_O_Diaeresis),
  110.       (LC_O_Oblique_Stroke, LC_Y_Diaeresis)));
  111.  
  112.    Special_Graphic_Set   : constant Wide_Character_Set := To_Set_R (
  113.      ((Wide_Space,          Solidus),
  114.       (Colon,               Commercial_At),
  115.       (Left_Square_Bracket, Grave),
  116.       (Left_Curly_Bracket,  Tilde),
  117.       (No_Break_Space,      Inverted_Question),
  118.       (Multiplication_Sign, Multiplication_Sign),
  119.       (Division_Sign,       Division_Sign)));
  120.  
  121.    ISO_646_Set           : constant Wide_Character_Set := To_Set_S
  122.      ((NUL,                 DEL));
  123.  
  124.    Character_Set         : constant Wide_Character_Set := To_Set_S
  125.      ((NUL,                 WC'Val (255)));
  126.  
  127.    Lower_Case_Map : constant Wide_Character_Mapping    := To_Mapping
  128.      ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"  &
  129.        UC_A_Grave                   &
  130.        UC_A_Acute                   &
  131.        UC_A_Circumflex              &
  132.        UC_A_Tilde                   &
  133.        UC_A_Diaeresis               &
  134.        UC_A_Ring                    &
  135.        UC_AE_Diphthong              &
  136.        UC_C_Cedilla                 &
  137.        UC_E_Grave                   &
  138.        UC_E_Acute                   &
  139.        UC_E_Circumflex              &
  140.        UC_E_Diaeresis               &
  141.        UC_I_Grave                   &
  142.        UC_I_Acute                   &
  143.        UC_I_Circumflex              &
  144.        UC_I_Diaeresis               &
  145.        UC_Icelandic_Eth             &
  146.        UC_N_Tilde                   &
  147.        UC_O_Grave                   &
  148.        UC_O_Acute                   &
  149.        UC_O_Circumflex              &
  150.        UC_O_Tilde                   &
  151.        UC_O_Diaeresis               &
  152.        UC_O_Oblique_Stroke          &
  153.        UC_U_Grave                   &
  154.        UC_U_Acute                   &
  155.        UC_U_Circumflex              &
  156.        UC_U_Diaeresis               &
  157.        UC_Y_Acute                   &
  158.        UC_Icelandic_Thorn,
  159.  
  160.       "abcdefghijklmnopqrstuvwxyz"  &
  161.        LC_A_Grave                   &
  162.        LC_A_Acute                   &
  163.        LC_A_Circumflex              &
  164.        LC_A_Tilde                   &
  165.        LC_A_Diaeresis               &
  166.        LC_A_Ring                    &
  167.        LC_AE_Diphthong              &
  168.        LC_C_Cedilla                 &
  169.        LC_E_Grave                   &
  170.        LC_E_Acute                   &
  171.        LC_E_Circumflex              &
  172.        LC_E_Diaeresis               &
  173.        LC_I_Grave                   &
  174.        LC_I_Acute                   &
  175.        LC_I_Circumflex              &
  176.        LC_I_Diaeresis               &
  177.        LC_Icelandic_Eth             &
  178.        LC_N_Tilde                   &
  179.        LC_O_Grave                   &
  180.        LC_O_Acute                   &
  181.        LC_O_Circumflex              &
  182.        LC_O_Tilde                   &
  183.        LC_O_Diaeresis               &
  184.        LC_O_Oblique_Stroke          &
  185.        LC_U_Grave                   &
  186.        LC_U_Acute                   &
  187.        LC_U_Circumflex              &
  188.        LC_U_Diaeresis               &
  189.        LC_Y_Acute                   &
  190.        LC_Icelandic_Thorn);
  191.  
  192. end Ada.Strings.Wide_Maps.Wide_Constants;
  193.